<script setup lang="ts">
import { ref } from 'vue'
import ORShowInfo from '@/views/organizer/OR_show_info.vue'

// 定义当前选中的功能页
const currentView = ref('')

// 定义按钮点击处理函数
const showView = (viewName: string) => {
  currentView.value = viewName
}
</script>

<template>
    <div class="OR_menu">
        <h1 class="page-title">用户功能菜单</h1>

        <div class="container">
          <!-- 左侧按钮区域 -->
          <div class="button-column left-column">
            <button class="menu-button" @click="showView('view1')">账号信息管理</button>
            <button class="menu-button" @click="showView('view2')">报名审核</button>
            <button class="menu-button" @click="showView('view3')">成绩录入</button>
            <button class="menu-button" @click="showView('view4')">场地安排</button>
          </div>

          <!-- 中间内容展示区域 -->
          <div class="content-area">
            <div v-if="currentView === 'view1'" class="content-view">
              <ORShowInfo />
            </div>
            <div v-else-if="currentView === 'view2'" class="content-view">
              <h2>报名审核</h2>
              <p>在这里您可以审核参赛者的报名信息，批准或拒绝报名申请。</p>
            </div>
            <div v-else-if="currentView === 'view3'" class="content-view">
              <h2>成绩录入</h2>
              <p>在这里您可以录入和管理各项比赛的成绩信息。</p>
            </div>
            <div v-else-if="currentView === 'view4'" class="content-view">
              <h2>场地安排</h2>
              <p>在这里您可以安排和管理比赛场地的使用情况。</p>
            </div>
            <div v-else-if="currentView === 'view5'" class="content-view">
              <h2>裁判管理</h2>
              <p>在这里您可以管理裁判信息，分配裁判任务。</p>
            </div>
            <div v-else-if="currentView === 'view6'" class="content-view">
              <h2>物资管理</h2>
              <p>在这里您可以管理比赛所需物资的采购、分配和使用情况。</p>
            </div>
            <div v-else-if="currentView === 'view7'" class="content-view">
              <h2>财务结算</h2>
              <p>在这里您可以查看和管理赛事相关的财务信息。</p>
            </div>
            <div v-else-if="currentView === 'view8'" class="content-view">
              <h2>数据统计</h2>
              <p>在这里您可以查看各类数据统计报表，为决策提供支持。</p>
            </div>
            <div v-else class="default-view">
              <h2>欢迎使用主办方管理系统</h2>
              <p>请选择左侧功能菜单开始操作</p>
            </div>
          </div>

          <!-- 右侧按钮区域 -->
          <div class="button-column right-column">
            <button class="menu-button" @click="showView('view5')">裁判管理</button>
            <button class="menu-button" @click="showView('view6')">物资管理</button>
            <button class="menu-button" @click="showView('view7')">财务结算</button>
            <button class="menu-button" @click="showView('view8')">数据统计</button>
          </div>
        </div>
    </div>
</template>


<style scoped>
.OR_menu {
  width: 100%;
  height: 100%;
}

.page-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0 0;
  color: #2E7D32;
  text-shadow: 0 0 6px rgba(56, 142, 60, 0.4);
  background: linear-gradient(to right, #2E7D32, #81C784);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: '微软雅黑 Light', sans-serif;
}

.container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  height: calc(100vh - 150px); /* 减去标题和其他元素的高度 */
  gap: 30px;
  padding: 20px;
  box-sizing: border-box;
  /* 容器本身不需要滚动条 */
  min-width: 0; /* 允许容器收缩以适应屏幕 */
}

.button-column {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 15%;
  height: 100%;
  flex-shrink: 0; /* 防止按钮列被压缩 */
}

.left-column {
  align-items: flex-start;
}

.right-column {
  align-items: flex-end;
}

.menu-button {
  width: 100%;
  padding: 20px 15px;
  margin: 15px 0;
  background: linear-gradient(to right, #66BB6A, #43A047);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  font-family: '微软雅黑 Light', sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.menu-button:hover {
  background: linear-gradient(to right, #558B2F, #388E3C);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.content-area {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #A5D6A7;
  border-radius: 12px;
  padding: 30px;
  box-sizing: border-box;
  min-height: 500px;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.1),
    inset 0 0 10px rgba(129, 199, 132, 0.2);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden; /* 防止内容区域出现不必要的滚动条 */
  min-width: 0; /* 允许内容区域收缩以适应容器 */
}

.content-view, .default-view {
  width: 100%;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto; /* 只有当内容真正超出时才显示滚动条 */
}

.content-view h2, .default-view h2 {
  color: #2E7D32;
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: bold;
  font-family: '微软雅黑 Light', sans-serif;
}

.content-view p, .default-view p {
  color: #558B2F;
  font-size: 1.2rem;
  line-height: 1.6;
  font-family: '微软雅黑 Light', sans-serif;
}

.subtitle {
  text-align: center;
  font-size: 1.5rem;
  color: #388E3C;
  text-shadow: 0 0 4px rgba(56, 142, 60, 0.3);
  font-family: '微软雅黑 Light', sans-serif;
  margin-bottom: 20px;
}
</style>
